<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>JSON</title>
		
		<style>
			
			div{
				color: red;
				border: 1px solid red;
			}
		</style>
	</head>
	<body>
	</body>
	<script>
		
		//一般地用法
		var student1={"name":"张无忌","age":"21"};
		var name = student1.name;
		console.log(name);
		
		var age = student1.age;
		console.log(age);
		
		//http协议所有的东西都是一个字符串
		
		//json格式的字符串  还是是字符串
		var  s="{'name':'赵敏','age':'22'}";
		
		//把json格式的字符串转化成 json对象
		var  jsonObject =eval("("+s+")");
		console.log(jsonObject.name);
		console.log(jsonObject.age);
		
		
		//java 把java对象转化成json格式的字符串
		
		
	</script>
	
</html>
